<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="root">
        <h1>{{hello}}</h1>
        <button @click="revers">反转</button>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        new Vue({
            beforeCreate:() => {console.log('beforeCreate被触发');},
            created: () => {console.log('created被触发');},
            beforeMount: () => {console.log('beforeMount被触发');},
            mounted: () => {console.log('mounted被触发');},
            beforeUpdate: () => {console.log('beforeUpdata被触发');},
            updated: () => {console.log('updataed被触发');},
            BeforeDestroy: () => {console.log('beforeDestroy被触发');},
            destroyed: () => {console.log('destroyed被触发');},
            el: '#root',
            data: {
                hello: 'hello'
            },
            methods: {
                revers(){
                    this.hello = this.hello.split('').reverse().join('');
                }
            }
        })
    </script>
</body>
</html>